package org.javabasics.other;

import java.util.Comparator;

/**
 * Created by LUOLIANG on 2016/8/30.
 */
public class InstanceofTest {
    public static void main(String[] args) {
//        hello在编译时期是Object类型，实际上是String类型
        Object hello = "hello";

        System.out.println("字符串是否是Object的实例：" + (hello instanceof Object));

        System.out.println("字符串是否是String的实例：" + (hello instanceof String));

        System.out.println("字符串是否是Math的实例：" + (hello instanceof Math));

        System.out.println("字符串是否是Comparable接口的实例：" + (hello instanceof Comparable));
    }
}
